﻿<UserControl x:Class="Mengsk.Device.Devices.UI.DeviceConfig"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <ListBox  Name="lstDevices">
        <ListBox.ItemContainerStyle>
            <Style TargetType="ListBoxItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <GroupBox Header="{Binding Type}">
                                <StackPanel Orientation="Horizontal" Margin="5">
                                    <ComboBox Name="cbbDeviceTypes" ItemsSource="{Binding AvalibleTypeInfos}" DisplayMemberPath="Name" SelectionChanged="cbbDeviceTypes_SelectionChanged" Width="100" VerticalAlignment="Center" Margin="3"/>
                                    <TextBox Name="tbReadableValue" Text="{Binding ReadableValue}" IsReadOnly="True" Width="160" VerticalAlignment="Center" Margin="3"/>
                                    <Button Name="btnSetting" DataContext="{Binding}" VerticalAlignment="Center" Margin="3" Content="S" Width="40" Click="btnSetting_Click"/>
                                    <Button Name="btnTest" DataContext="{Binding}" VerticalAlignment="Center" Margin="3" Content="T" Width="40" Click="btnTest_Click"/>
                                    <Button Name="btnATest" DataContext="{Binding}" VerticalAlignment="Center" Margin="3" Content="AT" Width="40" Click="btnATest_Click"/>
                                </StackPanel>
                            </GroupBox>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ListBox.ItemContainerStyle>
    </ListBox>
</UserControl>
